package DataStructure;
import java.util.Arrays;
public class Test {
    public static void inorderArray(int[] array) {
        for (int i = 0; i < array.length; i++) {
            array[i] = i;
        }
    }
    public static void notInorderArray(int[] array) {
        for (int i = 0;i < array.length;i++) {
            array[i] = array.length-i;
        }
    }
    public static void testBulleSortTime(int[] array) {
        long startTime = System.currentTimeMillis();
        Sort.bubbleSort(array);
        long endTime = System.currentTimeMillis();
        System.out.println("冒泡排序的时间是"+(endTime-startTime));
        long startTime1 = System.currentTimeMillis();
        /*Sort.bubbleSort(array1);
        long endTime1 = System.currentTimeMillis();
        System.out.println("冒泡排序的时间是"+(endTime1-startTime1));*/
    }
    public static void main(String[] args) {
        int[] array = {5,3,10,7,4,6,2,8};
        int[] array1 = {1,2,3,4,5,6,7,8};
        int[] array2 = {5,3,10,7,4,6,2,8};
        int[] array3 = new int[100000000];
        int[] array4 = new int[100000000];
        Sort sort = new Sort();
        sort.insertSort(array);
        for (int i = 0; i < array.length; i++) {
            System.out.print(array[i]+" ");
        }
        System.out.println();
        sort.shellSort(array2);
        System.out.println(Arrays.toString(array));
        sort.bubbleSort(array1);
        System.out.println(Arrays.toString(array1));
        inorderArray(array3);
        notInorderArray(array4);
        testBulleSortTime(array3);
    }
}
